﻿<Window x:Class="Demos.ExplorerBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Demos"
    xmlns:odc="http://schemas.odyssey.com/wpf"
    Title="Odyssey Demo" Height="517" Width="577">
    <Window.Resources>
        <DataTemplate DataType="{x:Type local:FolderItem}">
            <TextBlock Text="{Binding Folder}"/>
        </DataTemplate>
        <Style TargetType="{x:Type odc:BreadcrumbItem}">
            <Setter Property="Image" Value="Web.png"/>
        </Style>
    </Window.Resources>
    <Grid Background="AliceBlue">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>          
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <odc:BreadcrumbBar x:Name="bar"  Focusable="True"
                           Margin="8"
                           Grid.ColumnSpan="2"
                           Path="Computer\C:\"
                           PopulateItems="BreadcrumbBar_PopulateItems"    
                           BreadcrumbItemDropDownOpened="bar_BreadcrumbItemDropDownOpened"
                           TraceBinding="{Binding Folder}"
                           ImageBinding="{Binding Image}"
                           PathConversion="BreadcrumbBar_PathConversion">
            <odc:BreadcrumbBar.Buttons>
                <Button Click="RefreshClick">Animate</Button>
                <Button Click="ShowStaticBreadcrumbBar">Breadcrumb</Button>
            </odc:BreadcrumbBar.Buttons>
            <odc:BreadcrumbBar.DropDownItems>
                <TextBlock Text="C:\Windows"/>
                <TextBlock Text="C:\Windows\System32"/>
                <TextBlock Text="C:\Users"/>
            </odc:BreadcrumbBar.DropDownItems>
            <odc:BreadcrumbItem Header="Desktop">
                <odc:BreadcrumbItem Header="Computer"/>
                <odc:BreadcrumbItem Header="Network"/>
                <odc:BreadcrumbItem Header="Control Panel"/>
                <odc:BreadcrumbItem Header="Recylce bin"/>
            </odc:BreadcrumbItem>
        </odc:BreadcrumbBar>
        <odc:ExplorerBar Grid.Row="1" Grid.Column="0" x:Name="explorerBar">
            <odc:OdcExpander Header="System Tasks" Image="AlignTableCellMiddleCenterHS.png" x:Name="expander1" IsExpanded="True">
                <StackPanel SnapsToDevicePixels="True">
                    <TextBlock Text="View system information" TextWrapping="Wrap" Margin="0,0,0,4" x:Name="text1" />
                    <TextBlock Text="Add or remove programs" TextWrapping="Wrap" Margin="0,4,0,4" x:Name="text2" />
                    <TextBlock Text="Change Settings" TextWrapping="Wrap" Margin="0,4,0,4" x:Name="text3"/>
                    <Separator/>
                    <TextBlock Text="{Binding Path, ElementName=bar}" Margin="0,4,0,0"/>
                </StackPanel>
            </odc:OdcExpander>
            <odc:OdcExpander Header="Test" x:Name="expander2"
                             HeaderBackground="Gold"
                             Image="AlignTableCellMiddleCenterHS.png">
                <StackPanel>
                    <Button Click="Button_Click_3" Panel.ZIndex="1">Show/Hide</Button>
                    <Button Click="Button_Click_1">Resize System Tasks</Button>
                </StackPanel>
            </odc:OdcExpander>
            <odc:OdcExpander Header="Multi Anim">
                <StackPanel>
                    <Button Click="Animate1Click" Margin="0,0,0,4">Animate 1</Button>
                    <Button Click="Animate2Click" Margin="0,4,0,0">Animate 2</Button>
                </StackPanel>
            </odc:OdcExpander>
        </odc:ExplorerBar>
        <StackPanel Grid.Row="1" Grid.Column="1" >
            <odc:OdcExpander Header="My Expander" >
                <StackPanel>
                    <Button Click="Button_Click" Margin="0,0,0,4">Steel Blue</Button>
                    <Button Click="Button_Click_1" Margin="0,4,0,0">Gold</Button>
                </StackPanel>
            </odc:OdcExpander>
            <StackPanel.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="AliceBlue" Offset="0"/>
                        <GradientStop Color="Orange" Offset="0.5"/>
                        <GradientStop Color="OrangeRed" Offset="1"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </StackPanel.Background>
        </StackPanel>
    </Grid>
</Window>
